//
//  CCCollectionView.m
//  SmartHomeViews
//
//  Created by haimen_ios_imac on 2017/6/20.
//  Copyright © 2017年 深圳海曼科技有限公司. All rights reserved.
//

#import "CCCollectionView.h"

@implementation CCCollectionView

- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
    if (self = [super initWithFrame:frame collectionViewLayout:layout]) {
        
        [self setBackgroundColor:[UIColor whiteColor]];
        self.showsVerticalScrollIndicator = NO;
        self.showsHorizontalScrollIndicator = NO;
        [self setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
    }
    return self;
}


+ (instancetype)colletionViewWithFrame:(CGRect)frame
                                layout:(UICollectionViewFlowLayout *)layout
                              delegate:(id)delegate
                            datasource:(id)datasource
{
    
    CCCollectionView *collectionView = [[CCCollectionView alloc] initWithFrame:frame collectionViewLayout:layout]; 
    collectionView.delegate = delegate;
    collectionView.dataSource = datasource;
    return collectionView;
}

@end
